#!/bin/bash

if [ -d "/etc/haproxy" ]
then

sudo sh -c "echo '
listen http-proxy-81
    mode http
    bind *:81
    server server1 10.126.253.14:8080 maxconn 2
' > /etc/haproxy/http-proxy-81.cfg"

sudo service haproxy restart

### iptables ###

iptables -A INPUT -m tcp -p tcp --dport 81 -j ACCEPT

netfilter-persistent save

fi

